Implement Standalone Nexus Operations#1461
Conversation
…n defaults for id_reuse_policy and id_conflict_policy. Update integration tests with better typing and new assertions for the newly interceptable get_nexus_operation_result
…with a NexusOperationFailureError
ce1bade to
325d8bc
Compare
…ch start/execute operation. Fix hardcoded retryable=True in fallback error serialization. Add type tests and rename test/nexus/test_type_errors.py to ensure that the type test file properly executes nexus tests.
…ion of sdk-core. Reference cli prerelease in tests. Add sano required dynamic config values to test server. unskip additional failure details test.
…s links out. Shield task completion to core so we don't drop the rust future that _must_ complete for shutdown to succeed. Add flake finder as dev dependency.
THardy98
left a comment
There was a problem hiding this comment.
Did a quick passthrough
| _metadata_decoded: bool = field( | ||
| kw_only=True, default=False, compare=False, repr=False | ||
| ) | ||
|
|
There was a problem hiding this comment.
I'm not sure if we need a field for this. I know we did this for workflow description, but I think it's reasonable to just lazy decode on demand without mutating _static_details or _static_summary.
nbd either way, thought I'd mention it
| """List standalone Nexus operations. | ||
|
|
There was a problem hiding this comment.
Maybe I'm missing something obvious but I don't see how this is scoped to standalone Nexus operations (and same for other nexus ops on the client)
There was a problem hiding this comment.
Operations via workflow are accessed via workflow.create_nexus_client() which starts operations via workflow commands through the bridge to core. The operation lifecycle changes are tracked as part of workflow history. The implementation for this version of the NexusClient lives in workflow.py and only supports start/execute operation.
This new client scope NexusClient goes through the grpc API for SANO. These operations are tracked separately as a CHASM execution so it has it's own state and visibility rather than being part of workflow history. These executions can be listed, counted, etc in the same way that standalone activities. All this functionality lives in client.py for accessing it outside of workflow contexts.
…ests that validate that the arg is required
NOTE FOR REVIEWERS: This PR is pending the actual release of the API and Server and will not be merged until those are complete.
Add Standalone Nexus Operation Support
API Changes
Client.create_nexus_client()- Create a typedNexusClientfrom an endpoint & nexusrpc.ServiceClient.list_nexus_operations()- List operations via visibility queryClient.count_nexus_operations()- Count operations via visibility queryClient.get_nexus_operation_handle()- Create a typedNexusOperationHandleto an existing operationNexusClient.start_operation()- Start a Nexus Operation and return aNexusOperationHandle.NexusClient.execute_operation()- Same asstart_operation, but poll the handle for the final result.NexusOperationHandle.result()/.describe()/.cancel()/.terminate()/ property accessors - interact with an existing operation.Interceptor Support
The following methods have been added to
OutboundInterceptorstart_nexus_operation()describe_nexus_operation()cancel_nexus_operation()terminate_nexus_operation()list_nexus_operations()count_nexus_operations()Testing
Added integration test suite tests/nexus/test_standalone_operations.py (858 lines) covering start, get result, describe, cancel, terminate, list, count, ID conflict/reuse policies, and interceptor integration
Misc Changes
rufftarget version topy310to match the minimum support Python version.